System activity data can be accessed at the special request of a user
(see _s_a_r(1)) and automatically on a routine basis as described here. The
operating system contains a number of counters that are incremented as
various system actions occur. These include counters for CPU
utilization, buffer usage, disk I/O activity, TTY device activity,
switching and system-call activity, file-access, queue activity, inter-
process communications, paging and graphics.
_s_a_d_c and shell procedures, _s_a_1 and _s_a_2, are used to sample, save, and
process this data.
_s_a_d_c, the data collector, samples system data _n times every _t seconds and
writes in binary format to _o_f_i_l_e or to standard output. If _t and _n are
omitted, a special record is written. This facility is used at system
boot time, when booting to a multiuser state, to mark the time at which
the counters restart from zero. For example, the ////eeeettttcccc////iiiinnnniiiitttt....dddd////ppppeeeerrrrffff file
writes the restart mark to the daily data by the command entry:
su sys -c "/usr/lib/sa/sadc /var/adm/sa/sa`date +%d`"
The shell script _s_a_1, a variant of _s_a_d_c, is used to collect and store
data in binary file ////vvvvaaaarrrr////aaaaddddmmmm////ssssaaaa////ssssaaaa_d_d where _d_d is the current day. The
arguments _t and _n cause records to be written _n times at an interval of _t
seconds, or once if omitted. The entries in ////uuuussssrrrr////ssssppppoooooooollll////ccccrrrroooonnnn////ccccrrrroooonnnnttttaaaabbbbssss////ssssyyyyssss
(see _c_r_o_n(1M)):
0 * * * 0-6 /usr/lib/sa/sa1
20,40 8-17 * * 1-5 /usr/lib/sa/sa1
will produce records every 20 minutes during working hours and hourly
otherwise.
The shell script _s_a_2, a variant of _s_a_r(1), writes a daily report in file
////vvvvaaaarrrr////aaaaddddmmmm////ssssaaaa////ssssaaaarrrr_d_d. The options are explained in _s_a_r(1). The